#include "nvs_flash.h"
#include "mySys.h"
#include "myWifi.h"
#include "myTime.h"
#include "myWeather.h"

//static const char *TAG = "app";

void app_main(void)
{
    // 初始化wifi要先初始化nvs flash
    ESP_ERROR_CHECK(nvs_flash_init());

    myWifi_STA_Init();

    xTaskCreate(myTime_Task,
                "myTime_Task",
                2048,
                NULL,
                TASK_TIME_PRIORITY,
                NULL);

    xTaskCreate(myWeather_Task,
                "myWeather_Task",
                4096,
                NULL,
                TASK_WEATHER_PRIORITY,
                NULL);

    //uint16_t cnt = 0;
    while(1) {
        vTaskDelay(3000 / portTICK_PERIOD_MS);
        
        //cnt++;
        //ESP_LOGI(TAG, "running cnt = %d.", cnt);
    }

}
